<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - 快递管理系统</title>
    <link th:href="@{/webjars/bootstrap/5.3.2/css/bootstrap.min.css}" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
        }
        .login-container {
            max-width: 400px;
            margin: 100px auto;
            padding: 20px;
            background-color: white;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .login-title {
            text-align: center;
            margin-bottom: 30px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="login-container">
            <h2 class="login-title">快递管理系统</h2>
            <div th:if="${error}" class="alert alert-danger" th:text="${error}">
                用户名或密码错误
            </div>
            <div th:if="${message}" class="alert alert-success" th:text="${message}">
                您已成功退出
            </div>
            <!-- 保留原有的param方式作为备用 -->
            <div th:if="${param.error != null and (error == null or error == '')}" class="alert alert-danger">
                用户名或密码错误
            </div>
            <div th:if="${param.logout != null and (message == null or message == '')}" class="alert alert-success">
                您已成功退出
            </div>
            <form th:action="@{/login}" method="post">
                <div class="mb-3">
                    <label for="username" class="form-label">用户名</label>
                    <input type="text" class="form-control" id="username" name="username" required>
                </div>
                <div class="mb-3">
                    <label for="password" class="form-label">密码</label>
                    <input type="password" class="form-control" id="password" name="password" required>
                </div>
                <div class="d-grid">
                    <button type="submit" class="btn btn-primary">登录</button>
                </div>
            </form>
            
            <div class="text-center mt-3">
                <p>还没有账户？<a th:href="@{/register}" class="text-decoration-none">立即注册</a></p>
            </div>
        </div>
    </div>
    <script th:src="@{/webjars/bootstrap/5.3.2/js/bootstrap.bundle.min.js}"></script>
</body>
</html> 